<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Schools Management System</title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />

</head>
<body>
<?php
require_once '../Login/databaseconnection.php';
if(!loggedin())
{
require_once '../index.php';
}
else
{
	 if(isset($_POST['Register']))
	   { 
  $School_Id=$_POST['School_Id'];
  $Zone=$_POST['Zone'];
  $Division=$_POST['Division'];
  $Province=$_POST['Province'];
  $District=$_POST['District'];
  $Census_Number=$_POST['Census_Number'];
  $Name=$_POST['Name'];
  $Status=$_POST['Status'];
  $Type=$_POST['Type'];
  $Grade_Range=$_POST['Grade_Range'];
  $Medium=$_POST['Medium'];
  $Female_Students=$_POST['Female_Students'];
  $Male_Students=$_POST['Male_Students'];
  $Tp_Number=$_POST['Tp_Number'];
  $Fax_Number=$_POST['Fax_Number'];
  $E_Mail=$_POST['E_Mail'];
  $Web_Address=$_POST['Web_Address'];
  
  $Special_Projects=$_POST['Special_Projects'];
  $S_Pro="";
  for($i=0;$i<count($Special_Projects);$i++)
  {
	 $S_Pro+=$Special_Projects[$i];
  }
  
  $Address=$_POST['Address'];
  $Account_Number=$_POST['Account_Number'];
  
  require_once 'REG.php';
	   }
	   
/*
if($School_Id!=""&&$Zone!=""&&$Division!=""&&$Province!=""&&$District!=""&&$Census_Number!=""&&$Name!=""&&$Status!=""&&$Type!=""&&$Grade_Range!=""&&$Medium!=""&&$Female_Students!=""&&$Male_Students!=""&&$Tp_Number!=""&&$Fax_Number!=""&&$E_Mail!=""&&$Web_Address!=""&&$Special_Projects!=""&&$Map!=""&&$Address!=""&&$Account_Number!="")
	{
	require_once 'REG.php';
	}
	
if($School_Id==""||$Zone==""||$Division==""||$Province==""||$District==""||$Census_Number==""||$Name==""||$Status!=""&&$Type==""||$Grade_Range==""||$Medium==""||$Female_Students==""||$Male_Students==""||$Tp_Number==""||$Fax_Number==""||$E_Mail==""||$Web_Address==""||$Special_Projects==""||$Map==""||$Address==""||$Account_Number=="")
	{
		$_SESSION['errorin']="Please fill all!";
	
	}*/

?>
<div id="wrap">

<div id="header"><table width="1239" border="0">
  <tr>
    <td width="851" height="119" rowspan="2"><h1 class="heaaderte"><font color="#996699" style="text-shadow:#969" size="+6">Schools Management System</font></h1></td>
    <td width="141" height="88">&nbsp;</td>
    <td width="148">&nbsp;</td>
    <td width="81">&nbsp;</td>
  </tr>
  <tr>
    <td height="21">
   <?Php
	//$First_Name=$_SESSION['First_Name'];
    //$_SESSION['Last_Name']=$Last_Name;
	  if(isset($_SESSION['First_Name']))
	  
{
      echo "Hi,". $_SESSION['First_Name']." ".$_SESSION['Last_Name'];
}
?></td>
    <td><a href="../Logout.php" class="logout">Logout</a></td>
  </tr>
  </table>
</div>

<div id="menu1_bg">
		<div id="menu1">
			
	
	
			<ul>
				<li><a href="../index.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Home</font></a></li>
				<li><a href="Schools.php" class="active"><font color="#CCCC66" style="text-shadow:#969" size="+1">Schools</font></a></li>
				<li><a href="../Teachers/teachers.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Teachers</font></a></li>
				<li><a href="../Lab/Labs.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Labs</font></a></li>
				<li><a href="../Resources/Resources.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resources</font></a></li>
                <li><a href="#"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resource Team</font></a></li>
                         <li><a href="../Programmes/Programmes.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Programmes</font></a></li>
                                  <li><a href="../Competition/Competition.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Competitions</font></a></li>
                 <li></li>
			</ul>
	</div>
</div>
<div class="lefts">
  
<div class="articles">

<form action="#" method="POST">
  <table width="1000" border="0">
  <tr>
    <th height="18" colspan="10" align="left" scope="row">
    <?php
    if(isset($_POST['Register']))
{
	if(isset($_SESSION['errorin']))
	{
		echo $_SESSION['errorin'];
		unset($_SESSION['errorin']);
	}
	if(isset($_SESSION['error']))
	{
		echo $_SESSION['error'];
		unset($_SESSION['error']);
		
	}
	
}?></th>
    <td colspan="4">&nbsp;</td>
  </tr>
  </table>

  <table width="997">
  <tr background="../images/header11.jpg">
    <th width="456" height="27" align="left" scope="row"><legend><strong>BASIC INFORMATION</strong></legend></th>
    <td colspan="5"><legend><strong>CONTACT INFORMATION</strong></legend></td>
    <td width="173" colspan="4"><strong>BANK ACCOUNT DETAILS</strong></td>
   
     
  </tr>
  </table>
  <table bgcolor="#936" width="997">
  
  <tr>
    <th width="23" rowspan="14" align="left" scope="row" background="../images/header11.jpg">&nbsp;</th>
    <th width="78" height="32" scope="row" align="left"> <label> School ID </label>
    </th>
    <th width="8" scope="row" align="left">:-</th>
    <td width="142"><input type="text" name="School_Id"/></td>
    <td width="2">&nbsp;</td>
    <td width="59"><strong>School Status</strong></td>
    <td width="8">:-</td>
    <td width="112"><label>
      <input type="radio" name="Status" value="National" id="Status_0" />
      National</label>
      <br />
      <label>
        <input type="radio" name="Status" value="Provincial" id="Status_1" />
        Provincial</label></td>
    <td width="82" height="32"><label for="textfield"><strong>Telephone Number</strong></label></td>
    <td width="8"><strong>:-</strong></td>
    <td width="187"><input type="text" name="Tp_Number" id="textfield"/></td>
    <td width="0">&nbsp;</td>
    <td width="54"><strong>Account Number</strong></td>
    <td width="8"><strong>:-</strong></td>
    <td width="142"><input type="text" name="Account_Number" id="textfield11"  /></td>
    <td width="16" rowspan="14" background="../images/header11.jpg">&nbsp;</td>
  </tr>
  <tr>
    <th height="10" scope="row" align="left">&nbsp;</th>
    <th scope="row" align="left">&nbsp;</th>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td height="10">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="29" scope="row" align="left"> <label>School Name </label>
    </th>
    <th scope="row" align="left">:-</th>
    <td><input type="text" name="Name" /></td>
    <td>&nbsp;</td>
    <td>School Type</td>
    <td>:-</td>
    <td><label>
      <input type="radio" name="Type" value="1AB" id="Type_0" />
      1AB</label>
      <br />
      <label>
        <input type="radio" name="Type" value="1C" id="Type_1" />
        1C</label>
      <br />
      <label>
        <input type="radio" name="Type" value="2" id="Type_2" />
        2</label>
      <br />
      <label>
        <input type="radio" name="Type" value="3" id="Type_3" />
        3</label></td>
    <td height="29"><label for="textfield2"><strong>Fax Number</strong></label></td>
    <td><strong>:-</strong></td>
    <td><input type="text" name="Fax_Number" id="textfield2" /></td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr height="10">
    <th height="10" align="left" scope="row">&nbsp;</th>
    <th scope="row">&nbsp;</th>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td height="10">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="29" align="left" scope="row"> <label>School Address </label>
    </th>
    <th scope="row">:-</th>
    <td><input type="text" name="Address"/></td>
    <td rowspan="2">&nbsp;</td>
    <td rowspan="2"><strong>Grade Range</strong></td>
    <td rowspan="2">:-</td>
    <td rowspan="2"><label>
      <input type="radio" name="Grade_Range" value="1-5" id="Grade_Range_0" />
      1-5</label>
      <br />
      <label>
        <input type="radio" name="Grade_Range" value="1-11" id="Grade_Range_3" />
        1-11</label>
      <br />
      <label>
        <input type="radio" name="Grade_Range" value="1-13" id="Grade_Range_4" />
        1-13</label>
      <label> </label>
      <br />
      <label>
        <input type="radio" name="Grade_Range" value="6-11" id="Grade_Range_1" />
        6-11</label>
      <br />
      <label>
        <input type="radio" name="Grade_Range" value="6-13" id="Grade_Range_2" />
        6-13</label>
      <br />
      <label>
        <input type="radio" name="Grade_Range" value="Others" id="Grade_Range_5" />
        Others</label></td>
    <td height="29" rowspan="2"><label for="textfield3"><strong>Email Address</strong></label></td>
    <td rowspan="2"><strong>:-</strong></td>
    <td rowspan="2"><input type="text" name="E_Mail" id="textfield3"/></td>
    <td rowspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="54" align="left" scope="row">Census Number</th>
    <th scope="row">:-</th>
    <td><input type="text" name="Census_Number"/></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr height="10">
    <th height="10" align="left" scope="row">&nbsp;</th>
    <th scope="row">&nbsp;</th>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td height="10">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="27" align="left" scope="row"> <label>Division</label>
    </th>
    <th scope="row">:-</th>
    <td><input type="text" name="Division"/></td>
    <td>&nbsp;</td>
    <td><strong>Medium</strong></td>
    <td>:-</td>
    <td><label>
      <input type="radio" name="Medium" value="Tamil" id="Medium_0" />
      Tamil</label>
      <br />
      <label>
        <input type="radio" name="Medium" value="English" id="Medium_1" />
        English</label>
      <br />
      <label>
        <input type="radio" name="Medium" value="Mix(Tamil &amp; English)" id="Medium_2" />
        Mix(Tamil &amp; English)</label>
      <br />
      <label>
        <input type="radio" name="Medium" value="Sinhala" id="Medium_3" />
        Sinhala</label>
      <br />
      <label>
        <input type="radio" name="Medium" value="Mix(Tamil &amp; Sinhala)" id="Medium_4" />
        Mix(Tamil &amp; Sinhala)</label>
      <br />
      <label>
        <input type="radio" name="Medium" value="Mix(Tamil,English &amp; Sinhala)" id="Medium_5" />
        Mix(Tamil,English &amp; Sinhala)</label></td>
    <td height="27"><label for="textfield4"><strong>Web Address</strong></label></td>
    <td><strong>:-</strong></td>
    <td><input type="text" name="Web_Address" id="textfield4" /></td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="42" align="left" scope="row"> <label></label>
      Zone </th>
    <th scope="row">:-</th>
    <td><input type="text" name="Zone"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><strong>Special projects </strong></td>
    <td><strong>:-</strong></td>
    <td><label>
      <input type="checkbox" name="Special_Projects" value="OLPC" id="Special_Projects_0"/>
      OLPC</label>
      <br />
      <label>
        <input type="checkbox" name="Special_Projects" value="Interactive Whiteboard" id="Special_Projects_1" />
        Interactive Whiteboard</label>
      <br />
      <label>
        <input type="checkbox" name="Special_Projects" value="Others(P1.specify)" id="Special_Projects_2" />
        Others(Plz.specify)</label>
      <input type="text" name="Special_Projects" id="textfield10" /></td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="24" align="left" scope="row"> <label>District</label>
    </th>
    <th scope="row">:-</th>
    <td><input type="text" name="District"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="22" align="left" scope="row"><label>Province</label></th>
    <th scope="row">:-</th>
    <td><input type="text" name="Province"/></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="36" align="left" scope="row">Number of Students</th>
    <th scope="row">:-</th>
    <td colspan="6"><label for="Male4"><strong>Male</strong></label>
      <strong>:</strong>
      <input type="text" name="Male_Students" id="Male4"/>
      <label for="Female5"><strong>Female:</strong></label>
      <input type="text" name="Female_Students" id="Female5" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <th height="24" colspan="10" align="left" scope="row">Map:
      <input type="file" name="Browse2" value="Browse"/></th>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <th height="18" colspan="14" align="left" scope="row" background="../images/header11.jpg">&nbsp;</th>
    </tr>
  
  </table>
   <a href="AddSch.php">Reset</a>|
      <input name="Register" align="middle" type="submit" value="Register" />
 
  </form>
</div>
</div>

<div class="rightmenus"> 
      <h1>Schools</h1>
      <br/>
 <table width="190" border="0">
    <tr>
      <td height="41"><a href="UploadCsv.php">Upload New School's CSV file</a></td>
    </tr>
    <tr>
      <td height="41"><a href="AddSch.php">Add New School</a></td>
    </tr>
    <tr>
      <td height="41"><a href="SearchSch.php">Search a School's data</a></td>
    </tr>
    <tr>
      <td height="41"><a href="UpdateSch.php">Update a School's data</a></td>
    </tr>
    <tr>
      <td height="41"><a href="DelSch.php">Delete a School</a></td>
    </tr>
    <tr>
      <td height="41"><a href="Viewall.php">View All</a></td>
    </tr>
  </table>

</div>
 
 <div style="clear: both;"> </div>


<div id="footer">
  <table width="1217" height="50" border="0">
  <tr>
    <td width="903" height="46">Schools Managemrnt System &copy; 2012 </td>
    <td width="50"><strong><a href="#" class="active">Home</a><a href="#"></a></strong>|</td>
    <td width="91"><strong><a href="#">Contact us</a></strong>|</td>
    <td width="27"><a href="http//www.facebook.com"><img src="../images/facebook1.png" width="38" height="38"/></a></td>
    <td width="26"><a href="http//twitter.com"><img src="../images/twitter.png" width="38" height="38"/></a></td>
    <td width="26"><a href="http//www.google.lk"><img src="../images/google.png" width="38" height="38"/></a></td>
    <td width="64"><a href=""http="http"//www.yahoo.com""><img src="../images/yahoo.png" width="38" height="38"/></a></td>
  </tr>
</table>

</div>
</div>
<?php
	}

?>
</body>
</html>